<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="cache-control" content="max-age=0">
    <meta http-equiv="cache-control" content="no-cache">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>{$forumname}</title>
    <link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/base.min.1adad4a1.css">
    <link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/detail.min.e0b5430a.css">
    <link rel="stylesheet" type="text/css" href="{:ADDON_PUBLIC_PATH}/css/dialog.css"></link>
    <link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/iconfont.css">
    <script src="{:ADDON_PUBLIC_PATH}/js/jquery_min.js"></script>
    <script src="{:ADDON_PUBLIC_PATH}/js/main.js"></script>
    <script src="{:ADDON_PUBLIC_PATH}/js/dialog_min.js"></script>
    <script src="__STATIC__/layerm/layer.m.js"></script>
    <style>
        .content img{background: none}
        .name-wrap .user-nick{max-width: 400px}
    </style>
    <script>
        function delComment(thi ,cid){
            alert('确定删除："'+thi.parentNode.innerText.slice(0, 7)+'..."吗？',null, function(){
                loading(true);
                $.ajax({
                    url: "{:U('delComment',array('token'=>get_token(),'wecha_id'=>get_mid()))}",
                    type:"post",
                    data:'cid='+cid,
                    success: function(res){
                        loading(false);

                        if(1 == res){
                            $(thi).closest("li").remove();
                            location.reload();
                        }else{
                            alert("失败", 1500);
                        }
                    },
                    error: function(){
                        loading(false);
                        alert("删除失败", 1500);
                    }
                });
            }, function(){});
        }

        function showOperate(type, thi, evt){
            var pop_operate = document.getElementById("pop_operate");
            if(type){
                var btns = thi.innerHTML;
                pop_operate.querySelectorAll("div.pop_container")[0].innerHTML = btns;
                pop_operate.classList.add("on");
            }else{
                pop_operate.classList.remove("on");
            }
        }


        function collectTrends(tid, uid){
            loading(true);
            $.post("{:U('likeAjax',array('token'=>get_token()))}",{
                "tid"  : tid,
                "uid"  : uid,
            },function(res){
                loading(false);
                if(res) {
                    location.reload();
                }

            });
        }
        function praiseTrends(tid, uid){
            loading(true);
            $.post("{:U('favourAjax',array('token'=>get_token()))}",{
                "tid"  : tid,
                "uid"  : uid,
            },function(res){
                loading(false);
                if(res) {
                    location.reload();
                }

            });
        }

        function commentPraise(id,uid) {
            loading(true);
            $.post("{:U('commentFavourAjax',array('token'=>get_token()))}",{
                "id"  : id,
                "uid"  : uid,
            },function(res){
                loading(false);
                if(res) {
                    location.reload();
                }
            });
        }
        function link(url){
            if(url){
                window.location = url;
            }
        }
    </script>
</head>
<body id="detail_body" class="android topic-detail" style="overflow-y: scroll;">
<div class="detail-main" id="js_detail_main">
    <div class="top-content" id="js_detail_scroll_top">
        <div id="top_post_wrapper">
            <div class="post-title-wrapper" id="detail_top_info_header">
                <div class="user-info section-1px js-user-info" data-profile-uin="o3ztss672c3Qe53Q6GExQInsqbnY">
                    <div class="user-avatar" data-profile-uin="o3ztss672c3Qe53Q6GExQInsqbnY">
                        <img src="{$topics.user.headimgurl|get_cover_url}?empty" onerror="this.src='{:ADDON_PUBLIC_PATH}/images/logo.png';">
                        <span class="g-level level-1"></span>
                    </div>
                    <div class="name-wrap">
                        <span class="author user-nick "> {$topics.uname} </span></div>
                    <!--<div class="arrow-right"></div>-->
                </div>
                <div class="post-title js-detail-title allow-copy"> {$topics.title}</div>
                <div class="post-title-info">
                    <span class="time">{:date('Y-m-d H:i:s',$topics['createtime'])}</span>
                    <!--<span class="detail-from">  </span>-->
                </div>
            </div>
            <div class="post-wrapper" id="detail_top_info">
                <div class="content-wrapper allow-copy">
                    <div>
                        <div class="content" soda-bind-html="post|processContent|matchSearch">{:htmlspecialchars_decode($topics['content'],ENT_QUOTES)}</div>
                        <notempty name="topics['photos']">
                            <php>
                                $photos = explode(',',$topics['photos']);
                                $count = count($photos);
                            </php>
                            <volist name="photos" id="vo">
                                <div soda-repeat="pic in post.pic_list" class="img-box pre-size" style="width: 100%">
                                    <img src="{:get_cover_url($vo)}">
                                </div>
                            </volist>

                        </notempty>
                        <div class="video-preview">
                            <div class="icon-play">
                                <div class="triangle"></div>
                            </div>
                            <div class="preview-box"></div>
                        </div>
                    </div>
                </div>
                <div class="appreciation" id="detail_appreciation">
                    <div class="appreciation-list-wrapper">
                        <div class="appreciation-list "></div>
                    </div>
                </div>
                <div class="actions">
                    <!--<div soda-if="addr &amp;&amp; addr.city" class="location-area text-overflow-ellipsis">-->
                    <!--<span href="javascript:;" class="location" data-lat="36556149" data-lon="116807600"-->
                    <!--data-buzid="">济南</span>-->
                    <!--</div>-->
                    <span class="read-num"><i class="read-num-icon"></i>{$cnum}</span>
                </div>
            </div>
            <div class="nav-wrapper" id="bar_nav_wrapper"></div>
            <div id="comment-block-header" class="btn-comment-operate show-inturn reverse section-1px" style="display: block;">
                <div class="leftside-all-icon all"></div>
                <span>全部评论</span> <a id="btnShowInturn" href="javascript:;"></a>
            </div>
            <div class="btn-comment-operate show-more-before" style="">
                <a id="show-more-before" href="javascript:;">点击显示更多</a>
            </div>
        </div>
        <div class="detail-comment-list" id="js_detail_list">
            <div id="top_comment_wrapper">
                <ul class="lists" id="comment_page_0">
                    <volist id="comment" name="comment">
                        <li id="comment_1" class="list  section-1px ">
                            <div class="comment-wrapper">
                                <div class="user-avatar">
                                    <img src="{$comment.uinfo.headimgurl|get_cover_url}?empty" onerror="this.src='{:ADDON_PUBLIC_PATH}/images/face.png';">
                                    <span soda-if="!_isStarGroup" class="g-level level-1"></span>
                                </div>
                                <div class="name-wrap">
                                    <span class="author user-nick " >{$comment.uname} <if condition="$comment['replyid'] neq NULL"><span style="color: #2d4b9b;font-weight: bold">回复</span> {$comment.reuname}</if></span>
                                    <!--<label class="author-male"></label>-->
                                    <span></span>
                                    <!--<span><span class="honour border-1px poster">楼主</span></span>-->
                                    <span class="floor">{$i}楼</span>
                                </div>
                                <div class="content-wrapper">
                                    <div class="content allow-copy">{$comment.content|htmlspecialchars_decode}</div>
                                </div>
                                <div class="actions">
                                    <span class="btn-action time">{:date('Y-m-d H:i:s',$comment['createtime'])}</span>
                                    <span class="btn-action reply" onclick="link('{:U('recomment',array('cid'=>$comment['id'],'tid'=>$topics['id'],'reid'=>$comment['uid'],'wecha_id'=>get_mid(),'token'=>get_token()))}')"></span>
                                    <span class="btn-action like <if condition="in_array($wecha_id,explode(',',$comment['favourid']))"> liked </if>" onclick="commentPraise({$comment.id},{$wecha_id})"><if condition="$comment['favourid'] neq NULL">{:count(explode(',',$comment['favourid']))}<else />0</if></span>
                                </div>
                            </div>
                        </li>
                    </volist>
                </ul>
            </div>
            <div class="loading spinner" id="js_comment_loading" style="display: none;">载入中，请稍候...</div>
            <div id="bottom_comment_wrapper"></div>
        </div>
        <div class="empty-comment" style="display: <empty name="comment">block <else/>none</empty>;" >暂无评论，快来抢沙发</div>
    </div>
</div>
<div class="bottom-bar section-1px" style="visibility: visible;">
    <a href="javascript:;" class="item icon-forward" onclick="link('{:U('index',array('wecha_id'=>get_mid(),'token'=>get_token()))}')" id="to_forward">返回</a>
    <a href="javascript:;" class="item icon-reply" id="to_reply" onclick="link('{:U('commentAdd',array('wecha_id'=>get_mid(),'token'=>get_token(),'tid'=>$topics['id']))}')">{$comment_count}</a>
    <a href="javascript:;" class="item icon-like <php>if(in_array($wecha_id,explode(',',$topics['likeid']))){echo 'liked';}else{ }</php>" onclick="collectTrends({$topics.id},'{$wecha_id}');" id="to_like"><if condition="in_array($wecha_id,explode(',',$topics['likeid']))">{:count(explode(',',$comment['likeid']))}<else />0</if></a>
</div>
</body>
</html>